package lab02.test11;

/**
 * Created by ASUS on 2017/10/21.
 */
public class Rectangle implements Printx {

    //定义边长

    double a,b;
    Rectangle(double a,double b){

        this.a = a;
        this.b = b;
    }
    public double getArea(){

        return a * b;
    }
    public double getPerimeter(){

        return 2 * (a + b);
    }
    public void printMyWay() {
        System.out.println("矩形的长a="+a+"宽b="+b);
        System.out.println("面积s="+getArea());
        System.out.println("周长1="+getPerimeter());
    }
}
